import http from '@/rquest/index.js'

//轮播图接口
export const getBanner=()=>http({url:'/getbanner'})
//首页商品
export const getHomelist=()=>http({url:'/gethortgoods'})
//首页秒杀
export const getseckill=()=>http({url:'/getseckill'})

// 分类一二级数据
export const getCate = () => http({
	url: '/getcates'
})

// 获取购物车列表
export const cartlist = data => http({
	url: '/cartlist',
	data,
	header:{
		authorization:uni.getStorageSync('user').token
	}
})

export const getGoodslist = data => http({
	url: '/getgoodlist',
	data
})

// 获取验证码
export const getsms =data =>http({
	url: '/sms',
	data
}) 

export const login =data =>http({
	url: '/smslogin',
	method:'post',
	data
}) 

export const wxLogin =data =>http({
	url: '/wxlogin',
	method:'post',
	data
}) 


// 获取一个商品信息
export const getgGoodsinfo = data => http({
url: '/getgoodsinfo',
data
})

// 封装一个购物车添加接口
export const Cartadd = data => http({
url: '/cartadd',
method: 'post',
data,
header:{
	authorization:uni.getStorageSync('user').token
}

})
// 封装一个购物车添加接口
export const cartedit = data => http({
url: '/cartedit',
method: 'post',
data,
header:{
	authorization:uni.getStorageSync('user').token
}
})

// 封装一个添加地址
export const addressadd = data => http({
url: '/addressadd',
method: 'post',
data,
header:{
	authorization:uni.getStorageSync('user').token,
	contentType:'application/json'
}
})
// 封装一个修改地址
export const addressedit = data => http({
url: '/addressedit',
method: 'post',
data,
header:{
	authorization:uni.getStorageSync('user').token,
	contentType:'application/json'
}
})

// 封装一个获取地址
export const addresslist = data => http({
url: '/addresslist',
method: 'get',
data,
header:{
	authorization:uni.getStorageSync('user').token,
	contentType:'application/json'
}
})
// 封装一个订单生成
export const orderadd = data => http({
url: '/orderadd',
method: 'post',
data,
header:{
	authorization:uni.getStorageSync('user').token,
	contentType:'application/json'
}
})